package object;

/**
 * @Author: Miyako
 * @Date: 2024-07-25-8:48
 * @Description: IOP面向接口编程
 */

interface A{
    void a(String s);
}

class B implements A{
    @Override
    public void a(String s) {
        System.out.println("B:"+s);
    }
}

class C implements A{
    @Override
    public void a(String s) {
        System.out.println("C:"+s);
    }
}
class mi{
    public void prt (A a ,String str){
        a.a(str);//多态
    }
}
public class IOP {
    public static void main(String[] args) {
        A a = new B();
        A c = new C();
        new mi().prt(c,"1");
    }
}
